package com.example.test;


@FunctionalInterface
interface Foo {
    //void sayHello();
    int add(int x,int y);
    default int div(int x,int y){
        return x/y;
    }
    public static int div2(int x, int y){
        return x/y;
    }
}

/**
 * 拷贝小箭头,落地大箭头
 */
public class LambdaExpressDemo {
    public static void main(String[] args) {
        Foo foo = (x, y) ->x+y;
        foo.add(5, 8);
        Foo.div2(3, 5);
        //Foo foo = Integer::sum;
        //System.out.println(foo.add(5, 7));
        //
        // Foo foo = () -> {
        //     System.out.println("----------hello java");
        // };
        // foo.sayHello();

        //Foo foo = new Foo() {
        //    @Override
        //    public void sayHello() {
        //        System.out.println("-------------hello  java");
        //    }
        //};
        //foo.sayHello();
    }
}
